$(function(){

/*扩展*/
$.fn.extend({

/*下拉菜单*/
downMenu:function(time,dwntg,css){
	this.mouseenter(function(){
		var menu=$(this);
		var downMenu=menu.find(dwntg);
		dlTime=setTimeout(function(){
			menu.addClass(css);
			downMenu.slideDown(time);
		},100)
	}).mouseleave(function(){
		var menu=$(this);
		var downMenu=menu.find(dwntg);
		clearTimeout(dlTime);
		downMenu.hide();
		menu.removeClass(css);
	})
}

})

/*弹出绑定框*/
$.fn.extend({
addCard:function(pop){

	var mtop=$(pop).height()/2;
	if($(".mask").length<=0){
		$("body").append("<div class='mask'></div>");
	}
	$(".mask").show();
	$(pop).show().css({"top":"50%","margin-top":-mtop,"position":"fixed"});
	$(pop).find(".close").click(function(event){
		closePop();
		event.preventDefault();
	});
	$(".mask").click(function(){
		closePop();
	})
	function closePop() {
		$(pop).hide();
		$(".mask").hide();
	}
}
})

$.fn.extend({

/*菜单切换*/
tabSwitch:function(){
	var tab=$(this).find("ul").eq(0).children("li");
	var swtCont=$(this).find("div ul");
	tab.mouseenter(function(){
		var index=tab.index(this);
		var nowTab=$(this);
		tab.find("a").click(function(event){
			event.preventDefault();
		})
		dlTime1=setTimeout(function(){
			tab.removeClass();
			nowTab.addClass("on");
			swtCont.hide().eq(index).fadeIn();
		},100)
	}).mouseleave(function(){
		clearTimeout(dlTime1);
	})
}

})

$.fn.extend({

/*背景移动动画*/
bgPstAnimate:function(nowX,afterX){
	$(this).hover(function(){
		var nowLink=$(this);
		dlTime2=setTimeout(function(){
			nowLink.animate({
				"background-position-x": afterX
			},200)
		},100)
	},function(){
		clearTimeout(dlTime2);
		$(this).animate({
			"background-position-x": nowX
		},200)
	})
}

})


$.fn.extend({

/*鼠标滑过显示弹出*/
showTgPop:function() {
	var nowTag=$(this);
	var nowPop=nowTag.find("p");
	nowPop.hide();
	nowTag.hover(function(){
		tgtime=setTimeout(function(){
			nowPop.slideDown(100);
		},200)
	},function(){
		clearTimeout(tgtime);
		nowPop.slideUp(100);
	})
}

})


$.fn.extend({
	/*商品tab展示*/
	divTabChange:function(tab,cont){
		var tabZone=$(this);
		var zoneCont=tabZone.find(cont);
		var zoneTab=tabZone.find(tab);
		zoneCont.hide().eq(0).show();
		zoneTab.find("li").eq(0).addClass("on");
		zoneTab.find("li").click(function(){
			zoneTab.find("li").removeClass();
			$(this).addClass("on");
			var index=zoneTab.find("li").index(this);
			zoneCont.hide().eq(index).show().css("opacity",0).animate({
				opacity:'1'
			},300);
		});
		zoneTab.find("a").click(function(event){
			event.preventDefault();
		});
	}
});
$.fn.extend({
	myDivTabChange:function(tab, cont){
		var tabZone=$(this);
		var zoneCont = tabZone.find(cont);
		var zoneTab = tabZone.find(tab);
		zoneTab.find("li").click(function(){
			zoneTab.find("li").removeClass();
			$(this).addClass("on");
			var index=zoneTab.find("li").index(this);
			zoneCont.hide();
			zoneCont.eq(index).show().css("opacity",0).animate({opacity:'1'},300);
		});
		zoneTab.find("a").click(function(event){
			event.preventDefault();
		});
	},

	ie7DivTabChange:function(tab, cont){
		var tabZone=$(this);
		var zoneTab = tabZone.find(tab);
		var zoneCont = $("#"+cont+"0");
		zoneTab.find("li").click(function(){
			zoneTab.find("li").removeClass();
			$(this).addClass("on");
			zoneCont.hide();
			var index=zoneTab.find("li").index(this);
			zoneCont = $("#"+cont+index);
			zoneCont.show().css("opacity",0).animate({opacity:'1'},300);
		});
		zoneTab.find("a").click(function(event){
			event.preventDefault();
		});
	}
});

$(".goodsArea").divTabChange(".gdTab",".gdWrap");
//$(".olderWrap").divTabChange(".olderTab",".orderWrap");
$(".personIn").divTabChange(".funcTab",".funcWrap");
$(".photoWrap").divTabChange(".phtap",".phtCont");
$(".msgWrap").divTabChange(".msgTab",".msgArea");
$("#msgNew").divTabChange(".msgCty",".msgZone");
$("#msgRead").divTabChange(".msgCty",".msgZone");
$(".yueWrap").divTabChange(".yueTap",".yueArea");
$(".shTypeArea").divTabChange(".shTytab",".shTyShow");
$(".ychArea").divTabChange(".ycharTab",".ycharWp");
$(".container").divTabChange(".hmTtlTb",".hmwrp");
$(".cpetWrp").divTabChange(".cpetab",".cpetList");
$(".hmMidpat").divTabChange(".mgzTabNav",".mgzMlist");
$(".hmMidpat").divTabChange(".gdsTabNav",".gdsMlist");

/*memememememe*/
$(".shadow_l").divTabChange(".shadow_Head",".shadow_data");
$(".invitation").divTabChange(".cont",".region");
$(".seemover_l").myDivTabChange(".title",".shadcont");

$.fn.extend({
/*商品列表滚屏*/
scrollGoodSet:function(list,mgx,num){
	var sclwrp=$(this);
	var sclWidth = $(this).find(list).width();
	var sclNum = $(this).find(list).find("li").length;
	var sclListlen = Math.ceil($(this).find(list).find("li").length/num)-1;
	var i = 0;
	$(this).find(list).find("ul").css("margin-left","0");
	$(this).find(".prev").hide();
	if(sclNum > num){
		sclwrp.find(".next").show();
	}
	else{
		sclwrp.find(".next").hide();
	}
	$(this).find(".prev").click(function() {
		if(i>0){
			i--;
			if(i==0){
				sclwrp.find(".prev").fadeOut(300);
			}
			sclwrp.find(".next").fadeIn(300);
			turnsclList(i);
		}
	});
	$(this).find(".next").click(function() {
		if(i<sclListlen){
			i++;
			if(i==sclListlen){
				sclwrp.find(".next").fadeOut(300);
			}
			sclwrp.find(".prev").fadeIn(300);
			turnsclList(i);
		}
	});
	$(this).find("a").click(function(event){
		event.preventDefault();
	});
	function turnsclList(index) {
		var nowLeft = -index*(sclWidth+mgx);
		sclwrp.find(list).find("ul").stop(true,false).animate({"margin-left":nowLeft},200);
	}
}

})


/*logo划屏*/
var xDist=$(".brandList").width();
var i_logo=0;
var xTime;

$(".brandArea .litBtn a").mouseenter(function(event){
	event.preventDefault();
	i_logo=$(".brandArea .litBtn a").index(this);
	logoTurn(i_logo);
}).eq(0).trigger("mouseenter");

$(".brandList").hover(function() {
	clearInterval(xTime);
	},function() {
		xTime = setInterval(function() {
		logoTurn(i_logo);
		i_logo++;
		if(i_logo == 3) {i_logo = 0;}
	},5000);
}).trigger("mouseleave");

function logoTurn(i_logo) {
	var nowLeft = -xDist*i_logo;
	$(".brandList ul").stop(true,false).animate({"margin-left":nowLeft},300);
	$(".brandArea .litBtn a").removeClass().eq(i_logo).addClass("on");
}

/*礼品首页banner划屏*/
var sWidth = $(".imgShow").width();
var len = $(".imgShow ul li").length;
var i_bnr = 0;
var picTimer;

for(var i=0;i<len;i++){
	$(".bnrArea .litBtn").append("<a href='#'><img src='/img/common/trans.png' width='25' height='25' alt=''></a>")
}

$(".bnrArea .litBtn a").mouseenter(function() {
	i_bnr = $(".bnrArea .litBtn a").index(this);
	showPics(i_bnr);
}).eq(0).trigger("mouseenter");

$(".imgShow ul").css("width",sWidth * (len));

$(".imgShow").hover(function() {
	clearInterval(picTimer);
	},function() {
		picTimer = setInterval(function() {
		showPics(i_bnr);
		i_bnr++;
		if(i_bnr == len) {i_bnr = 0;}
	},4000);
}).trigger("mouseleave");

function showPics(index) {
	var nowLeft = -index*sWidth;
	$(".imgShow ul").stop(true,false).animate({"margin-left":nowLeft},300);
	$(".bnrArea .litBtn a").removeClass("on").eq(index).addClass("on");
}

/*礼品众筹banner划屏*/
var bnrWidth = $(".showArea .gdShow").width();
var bnrlen = $(".showArea .gdShow li").length;
var now_bnr = 0;
var navli = $(".gdNav li").width();
var bnrTimer;

$(".gdNav li").mouseenter(function() {
	now_bnr = $(".gdNav li").index(this);
	showbnrs(now_bnr);
}).eq(0).trigger("mouseenter");

$(".showArea .gdShow ul").css("width",bnrWidth * (bnrlen));

$(".showArea .gdShow").hover(function() {
	clearInterval(bnrTimer);
	},function() {
		bnrTimer = setInterval(function() {
		showbnrs(now_bnr);
		now_bnr++;
		if(now_bnr == bnrlen) {now_bnr = 0;}
	},4000);
}).trigger("mouseleave");

function showbnrs(index) {
	var nowLeft = -index*bnrWidth;
	var btnLeft = (navli+8)*index+8;
	$(".showArea .gdShow ul").stop(true,false).animate({"margin-left":nowLeft},300);
	$(".showArea .showon").stop(true,false).animate({
		left:btnLeft
	},300)
}

/*商品图片展示*/
var prdListWidth = $(".specItem").width();
var prdListlen = Math.ceil($("#prdShow .specList li").length/4)-1;
var i_prd = 0;
$("#prdShow .specList ul").css("margin-left","0");
$("#prdShow .prev").hide();
$("#prdShow .prev").mouseenter(function() {
	if(i_prd>0){
		i_prd--;
		if(i_prd==0){
			$("#prdShow .prev").fadeOut(300);
		}
		$("#prdShow .next").fadeIn(300);
	}
	turnPrdList(i_prd);
});
$("#prdShow .next").mouseenter(function() {
	if(i_prd<prdListlen){
		i_prd++;
		if(i_prd==prdListlen){
			$("#prdShow .next").fadeOut(300);
		}
		$("#prdShow .prev").fadeIn(300);
	}
	turnPrdList(i_prd);
});
function turnPrdList(index) {
	var nowLeft = -index*prdListWidth;
	$("#prdShow .specList ul").stop(true,false).animate({"margin-left":nowLeft},300);
}
$("#prdShow .specList li").hover(function(){
	$("#prdShow .specList li").removeClass();
	$(this).addClass("on");
})


/*推荐商品轮换*/
var hstgdHeight = $(".sdlistWrp").height();
var hstscllen = Math.ceil($(".sdlistWrp .clmnList1 li").length/3);
var hstgd_bnr = 0;
var hstgdTimer;


for(var i=0;i<hstscllen;i++){
		$(".dotNav2").append("<li><img width='13' height='13' src='/img/common/trans.png' alt=''></li>")
}

$(".dotNav2 li").mouseenter(function() {
	hstgd_bnr = $(".dotNav2 li").index(this);
	hstshowGoods(hstgd_bnr);
}).eq(0).trigger("mouseenter");

$(".sdlistWrp .clmnList1").css("height",hstgdHeight * (hstscllen));

$(".sdlistWrp").hover(function() {
	clearInterval(hstgdTimer);
	},function() {
		hstgdTimer = setInterval(function() {
		hstshowGoods(hstgd_bnr);
		hstgd_bnr++;
		if(hstgd_bnr == hstscllen) {hstgd_bnr = 0;}
	},4000);
}).trigger("mouseleave");


function hstshowGoods(index) {
	var nowTop;
	if(index==0){
		nowTop=0;
	}
	else{
		nowTop = -index*hstgdHeight;
	}
	$(".sdlistWrp .clmnList1").stop(true,false).animate({"margin-top":nowTop},300);
	$(".dotNav2 li").removeClass("on").eq(index).addClass("on");
}



/*图片信息弹出*/
$(".showhold").find(".hold").hide();
var sldTime;
$(".showhold").hover(function(){
	var ngood=$(this);
	sldTime=setTimeout(function(){
		ngood.find(".hold").slideDown(400)
	},100);
},function(){
	clearTimeout(sldTime);
	$(this).find(".hold").slideUp(400);
})

/*栏目切换*/
$(".fesvTab li").mouseenter(function(){
	$(".fesvTab li").removeClass();
	$(this).addClass("on");
	var index=$(".fesvTab li").index(this);
	$(".fesvCont").css("display","none").eq(index).fadeIn(500);
})
/*logo鼠标滑过效果*/
var nowh2logo;
$(".logo").hover(function(){
	nowh2logo=$(this).find("h2 img").attr("src");
	$(this).find("h2 img").attr("src","/img/common/logo_slogen.gif");
},function(){
	$(this).find("h2 img").attr("src",nowh2logo);
})

/*自适应屏幕宽度*/
function winResize() {
		var winWidth=$(window).width();

	var bnrlen = $(".showArea .gdShow li").length;
	if(winWidth<1200){
		dist=32;
		$("body").addClass("w980");
		$("#browse").scrollGoodSet(".footList",0,4);
		$("#gpGdList").scrollGoodSet(".gpGoodWrp",1,3);
		$("#recommend").scrollGoodSet(".footList",0,4);
		$("#collect").scrollGoodSet(".clltList",48,3);
		$("#myfilm").scrollGoodSet(".itemList",0,3);
		$("#shts1").scrollGoodSet(".shTyWrp",10,3);
		$("#shts2").scrollGoodSet(".shTyWrp",10,3);
		$("#shts3").scrollGoodSet(".shTyWrp",10,3);
		$("#shts4").scrollGoodSet(".shTyWrp",10,3);
		$("#shts5").scrollGoodSet(".shTyWrp",10,3);
		$("#shts6").scrollGoodSet(".shTyWrp",10,3);

		/*礼品众筹banner划屏*/
		function showbnrs2(index){
			var btnLeft = 116*index;
			var nowLeft = -index*574;
			$(".showArea .gdShow ul").stop().animate({"margin-left":nowLeft},300);
			$(".showArea .showon").stop().animate({
				left:btnLeft
			},300)
		};

		$(".showArea .gdShow ul").css("width",574 * (bnrlen));
		$(".showArea .showon").css("top","0");
		var now_bnr1 = 0;
		$(".gdNav li").mouseenter(function() {

			now_bnr1 = $(".gdNav li").index(this);
			showbnrs2(now_bnr1);
		}).eq(0).trigger("mouseenter");

	}
	else{
		dist=45;
		$("body").removeClass();
		$("#browse").scrollGoodSet(".footList",9,5);
		$("#gpGdList").scrollGoodSet(".gpGoodWrp",1,4);
		$("#recommend").scrollGoodSet(".footList",9,5);
		$("#collect").scrollGoodSet(".clltList",9,3);
		$("#myfilm").scrollGoodSet(".itemList",0,4);

		/*礼品众筹banner划屏*/
		function showbnrs1(index) {
			var	btnTop = 123*index;
			var	nowLeft = -index*608;
			$(".showArea .gdShow ul").stop().animate({"margin-left":nowLeft},300);
			$(".showArea .showon").stop().animate({
				top:btnTop
			},300);
		};

		$(".showArea .gdShow ul").css("width",608 * (bnrlen));
		$(".showArea .showon").css("left","0");
		var now_bnr2 = 0;
		$(".gdNav li").mouseenter(function() {
			now_bnr2 = $(".gdNav li").index(this);
			showbnrs1(now_bnr2);
		}).eq(0).trigger("mouseenter");

	}



}



/*调用*/
winResize();
$(window).resize(function(){
	winResize();
})
$(".subMenu").downMenu(100,".mnCont","");
$(".myAcct").downMenu(50,"ul","open");
$(".phone").downMenu(50,"ul","open");
// $(".trolley").downMenu(50,".trlcont","open");
$(".service").downMenu(50,"ul","open");
$(".acctSet").downMenu(20,"ul","open");
$(".typeItem").downMenu(100,"ul","on");
$("#city.city").downMenu(100,".citychs","on");
$("#storeSelector").downMenu(100,".stCity","");
$("#calendar").downMenu(100,".fRight6","on");
$(".tipoff").downMenu(100,"a","hover");
$(".wuliu").downMenu(100,".prompt","");
$(".receiver").downMenu(100,".getmanPp","");
$("#preview .specList").scrollGoodSet(".specItem",0,4);
$("#ltmn1").downMenu(50, "ul", "open"),
$("#ltmn2").downMenu(50, ".trlcont", "open"),
$("#ltmn3").downMenu(50, "ul", "open"),
$("#ltmn4").downMenu(50, "ul", "open"),
$("#ltmn5").downMenu(50, ".shjq", "open"),
/*鼠标停留弹出层*/
$("#mail").showTgPop();
$("#phon").showTgPop();

/*显示弹出层*/
$(".showpop a").click(function(event){
	if($(".mask").length<=0){
		$("body").append("<div class='mask'></div>");
	}
	var now_i=$(".showpop a").index(this);
	event.preventDefault();
	var nowTab=$(this).text();
	$(".mask").hide();
	var popDiv=$(".photoPop");
	if(popDiv.css("display")=="none"){
		popDiv.show();
		$(".mask").show();
	};
	$(".mask").click(function(){
		closePop();
	});
	$(".photoPop .close").click(function(event){
		closePop();
		event.preventDefault();
	});
	showOpt(now_i);
	function closePop() {
		popDiv.hide();
		$(".mask").hide();
	}
	function showOpt(i) {
		$(".phtap li").removeClass().eq(i).addClass("on");
		$(".phtCont").hide().eq(i).show();
	}
})

/*二维码随屏滚动*/
$(window).scroll(function(){
	var dcmscl_height=$(document).scrollTop();
	if(dcmscl_height>620){
		$(".dmsCode").css("top",dcmscl_height);
	}
})
/*关闭二维码*/
$(".dmsClose").click(function(){
	$(".dmsCode").hide();
})

/*头像划过效果*/
$(".portrait a").hide();
$(".portrait").hover(function(){
	$(this).find("a").show();
},function(){
	$(this).find("a").hide();
})

/*左侧菜单开启&关闭*/
$(".menuPart h4").click(function(){
	var mainmenu=$(this);
	var submenu=$(this).siblings("ul");
	var substate=submenu.css("display");
	if(substate=="block"){
		submenu.slideUp(200);
		mainmenu.addClass("close");
	}
	else if(substate=="none"){
		submenu.slideDown(200);
		mainmenu.removeClass();
	}
})

/*图片划过效果*/
$(".phtCont table td").not($(".bdnone")).hover(function(){
	$(this).css("border","1px solid #ff4747");
},function(){
	$(this).css("border","1px solid #e5e5e5");
})

/*地址栏划过效果*/
$(".addrList .addtool a").hide();
$(".addrList .close").hide();
$(".addrList li").hover(function(){
	$(this).find(".addtool a").show();
	$(this).find(".close").show();
},
	function(){
	$(this).find(".addtool a").hide();
	$(this).find(".close").hide();
})
/**/
})

function onclickLogin(){
	spiderLogin.util.login();
	return;
}
function onclickRegister(){
	spiderLogin.util.registerfilm();
	return false;
}
function onclickLoginOut(){
	spiderLogin.util.logout();
	return false;
}

var spiderCommon = spiderCommon || {};
spiderCommon.util = {};
spiderCommon.util.favoriteC = function(subjectid, name){
	 var myname = "join";
	 if(name!=null && name!=''){myname = name;}
     var url_remote = "/jquery-second021.html?subjectid="+subjectid+"&subtype=1";
     url_remote = encodeURI(url_remote);
	 $.post(url_remote, null, function(data){
	 	var items = data.getElementsByTagName("item");
        var remain = items[0].childNodes[0].nodeValue;
		if(remain == "unlogin"){
		    onclickLogin();
		}else if(remain == "success"){
		    $("#"+myname+"_"+subjectid).css("display","none");
			$("#"+myname+"ed_"+subjectid).css("display","block");
		}else{
		   	tipsWindown("发表评论","text:<font color='black'>加入常去影院失败！</font>" , "480", "100", "true", "4000", "true", "text");
		}
	 });
}
spiderCommon.util.delfavoriteC = function(subjectid, name){
	 var myname = "join";
	 if(name!=null && name!=''){myname = name;}
     var url_remote = "/jquery-second021.html?flag=0&subjectid="+subjectid+"&subtype=1";
     url_remote = encodeURI(url_remote);
	 $.post(url_remote, null, function(data){
	 	var items = data.getElementsByTagName("item");
        var remain = items[0].childNodes[0].nodeValue;
		if(remain == "unlogin"){
		    onclickLogin();
		}else if(remain == "success"){
		    $("#"+myname+"ed_"+subjectid).css("display","none");
			$("#"+myname+"_"+subjectid).css("display","block");
		}else{
		   	tipsWindown("发表评论","text:<font color='black'>加入常去影院失败！</font>" , "480", "100", "true", "4000", "true", "text");
		}
	 });
}
spiderCommon.util.favoriteF = function(subjectid, name){
	 var myname = "join";
	 if(name!=null && name!=''){myname = name;}
     var url_remote = "/jquery-second021.html?subjectid="+subjectid+"&subtype=2";
     url_remote = encodeURI(url_remote);
	 $.post(url_remote, null, function(data){
	 	var items = data.getElementsByTagName("item");
        var remain = items[0].childNodes[0].nodeValue;
		if(remain == "unlogin"){
		    onclickLogin();
		}else if(remain == "success"){
			$("#"+myname+"_"+subjectid).css("display","none");
			$("#"+myname+"ed_"+subjectid).css("display","block");
		}else{
		   	tipsWindown("加入观影清单","text:<font color='black'>加入观影清单失败!</font>" , "480", "100", "true", "4000", "true", "text");
		}
	 });
}
spiderCommon.util.delfavoriteF = function(subjectid, name){
	 var myname = "join";
	 if(name!=null && name!=''){myname = name;}
     var url_remote = "/jquery-second021.html?flag=0&subjectid="+subjectid+"&subtype=2";
     url_remote = encodeURI(url_remote);
	 $.post(url_remote, null, function(data){
	 	var items = data.getElementsByTagName("item");
        var remain = items[0].childNodes[0].nodeValue;
		if(remain == "unlogin"){
		    onclickLogin();
		}else if(remain == "success"){
			$("#"+myname+"ed_"+subjectid).css("display","none");
			$("#"+myname+"_"+subjectid).css("display","block");
		}else{
		   	tipsWindown("加入观影清单","text:<font color='black'>加入观影清单失败!</font>" , "480", "100", "true", "4000", "true", "text");
		}
	 });
}

$(".mnList>li").hover(function(){
	var finalDiv=$(this).find(".fnMenuDiv");
	$(this).addClass("on");
	if(finalDiv.css("display")=="none"){
		finalDiv.show();
	}
},function(){
	$(this).removeClass("on");
	$(this).find(".fnMenuDiv").hide();
})

spiderCommon.util.delfavoriteF = function(subjectid, name){
	 var myname = "join";
	 if(name!=null && name!=''){myname = name;}
     var url_remote = "/jquery-second021.html?flag=0&subjectid="+subjectid+"&subtype=2";
     url_remote = encodeURI(url_remote);
	 $.post(url_remote, null, function(data){
	 	var items = data.getElementsByTagName("item");
        var remain = items[0].childNodes[0].nodeValue;
		if(remain == "unlogin"){
		    onclickLogin();
		}else if(remain == "success"){
			$("#"+myname+"ed_"+subjectid).css("display","none");
			$("#"+myname+"_"+subjectid).css("display","block");
		}else{
		   	tipsWindown("加入观影清单","text:<font color='black'>加入观影清单失败!</font>" , "480", "100", "true", "4000", "true", "text");
		}
	 });
}



spiderCommon.util.datingreport = function(dateid, event){
	var content = $("#applyContent").val();
	if(content == '想对TA说些什么引起TA的注意呢？'){
		content = "";
	}
	var url_remote = "/jquery-second024.html?dateid="+dateid+"&message="+content;
	url_remote = encodeURI(url_remote);
	$.post(url_remote, null, function(data){
	 	var items = data.getElementsByTagName("item");
        var remain = items[0].childNodes[0].nodeValue;
        var message = items[1].childNodes[0].nodeValue;
		if(remain == "0"){
		    chatPop(event,'#bmcg_popup');
		}else if(remain == "2"){
		    onclickLogin();
		}else if(remain == "3"){
		   	chatPop(event,'#jbzl_popup');
		}else if(remain == "4"){
		   	chatPop(event,'#yyxx_popup');
		}else{
			chatPop(event,'#info_popup');
	 		$("#info_popup_content").html(message);
	 		return;
		}
	 });
}


$(".mnList>li").hover(function(){
	var finalDiv=$(this).find(".fnMenuDiv");
	$(this).addClass("on");
	if(finalDiv.css("display")=="none"){
		finalDiv.show();
	}
},function(){
	$(this).removeClass("on");
	$(this).find(".fnMenuDiv").hide();
})

spiderCommon.util.delfavoriteF = function(subjectid, name){
	 var myname = "join";
	 if(name!=null && name!=''){myname = name;}
     var url_remote = "/jquery-second021.html?flag=0&subjectid="+subjectid+"&subtype=2";
     url_remote = encodeURI(url_remote);
	 $.post(url_remote, null, function(data){
	 	var items = data.getElementsByTagName("item");
        var remain = items[0].childNodes[0].nodeValue;
		if(remain == "unlogin"){
		    onclickLogin();
		}else if(remain == "success"){
			$("#"+myname+"ed_"+subjectid).css("display","none");
			$("#"+myname+"_"+subjectid).css("display","block");
		}else{
		   	tipsWindown("加入观影清单","text:<font color='black'>加入观影清单失败!</font>" , "480", "100", "true", "4000", "true", "text");
		}
	 });
}

function loginDiv(){
	var url_remote = ticket_host + "/jquery-second042.html";
	var url_param = window.location.href;
	$.post(url_remote, null, function(data){
			var result = data.getElementsByTagName("items");
			var bool = result[0].childNodes[0].nodeValue;
			if("true" == bool){
				window.location.href = url_param;
			}else if("cookie" == bool){
				window.location.href = "http://www.spider.com.cn/filmlogin.html?returnurl="+encodeURIComponent(url_param);
			}else if("false" == bool){
				var showTipWin = "<div id=\"tipBg\" style=\"display:none;position:fixed;	width:100%;	height:100%;	background:#000;/*body-bg*/	top:0;	left:0;height:"+$(document).height()+"px;filter:alpha(opacity=0);opacity:0.2;z-index:100\"></div>";
				showTipWin+= "<div class=\"popup1 f14 none\" style=\"position: fixed;z-index: 101;\" id=\"filmTips\"><h2 class=\"tc f16 sign\">用户登录</h2>";
				showTipWin+=  "<a href=\"javascript:void(0)\" class=\"signclose\" onclick=\"spiderCommon.util.closelogindiv();\"  style=\"color: #fff;\">X</a>";
				showTipWin +="<iframe id=\"iframeCT\" name=\"iframeCT\" src=\"http://www.spider.com.cn/filmlogin.html?returnurl="+encodeURIComponent(url_param) +"\" width=\"388\" height=\"460\" style=\"border:none;\"></iframe>";
				showTipWin += "</div>";
				$("body").append(showTipWin);
				$("#tipBg").show();
				$("#filmTips").show();
			}
		}
	);
}

spiderCommon.util.closelogindiv = function(){
	$("#filmTips").fadeOut("fast",function(){$(this).remove();});
	$("#tipBg").remove();
}


